/*******************************************OVERVIEW****************************************************************
 
"Reassessing the Link between Revolutionary Threats and Democratization" 
 
Replication File
 
Table E1
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 

cd "/Users/YourFiles/Replication/";

/*Create Log File*/;

log using "Table E1", replace text;


/*Load Data File*/;

use "data_outvoters.dta";


global base "county university narrow rottenindex"; 
global reform "share1826 share1826_2 reform_1830";
global demographic "h_index1831 primary secondary tetitary";
global structure "population1831 density1831 economictrend1 economictrend2";
global sign "county university rottenindex share1826 reform_1830 economictrend2";



gen group_1=(type=="SL" | type=="H");

gen fm=(type=="FM");



ttest constriots10, by(group_1);
ttest voters, by(group_1);
ttest constriots10, by(county);
ttest voters, by(county);
ttest constriots10 if c_borough==1, by(fm);
ttest voters if c_borough==1, by(fm);
ttest constriots10 if c_borough==1 & outvoter==0, by(fm);
ttest voters if c_borough==1 & outvoter==0, by(fm);
sum constriots10 if c_borough==1 & outvoter==1 & fm==1;
sum voters if c_borough==1 & outvoter==1 & fm==1;


reg share1831 constriots10 $reform $base $demographic $structure if group_1==1, robust;

reg share1831 constriots10 $reform $base $demographic $structure if county==1, robust;

reg share1831 constriots10 $reform $base $demographic $structure if type=="FM" & c_borough==1, robust;

reg share1831 c.constriots10##i.outvoter $reform $base $demographic $structure if type=="FM" & c_borough==1, robust;

margins, dydx(constriots10) at(outvoter =(0 1));

    

log c;
